package org.cpoy.ei.session;

import org.cpoy.eims.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("courseList")
public class CourseList extends EntityQuery<Course> {

	private static final String EJBQL = "select course from Course course";

	private static final String[] RESTRICTIONS = {
			"lower(course.courseName) like lower(concat(#{courseList.course.courseName},'%'))",
			"lower(course.details) like lower(concat(#{courseList.course.details},'%'))", };

	private Course course = new Course();

	public CourseList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Course getCourse() {
		return course;
	}
}
